package com.risetek.tft.entity;

import java.sql.Timestamp;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.OrderBy;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * TMenu entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_SYS_MENU")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class TMenu  extends BaseEntity2 implements java.io.Serializable {

	// Fields

	private TMenu TMenu;
	private String name;
	private String remark;
	private String img;
	private String channel;
	private String param;
	private Date addtime;
	private Date updatetime;
	private Boolean state;
	private Integer ordno;
	private Integer nlevel;
	private String scort;
	private Set<TOperate> TOperates = new HashSet<TOperate>(0);
	private Set<TMenu> TMenus = new HashSet<TMenu>(0);

	// Constructors

	/** default constructor */
	public TMenu() {
	}

	/** minimal constructor */
	public TMenu(String name, Timestamp addtime, Timestamp updatetime,
			Boolean state) {
		this.name = name;
		this.addtime = addtime;
		this.updatetime = updatetime;
		this.state = state;
	}

	/** full constructor */
	public TMenu(TMenu TMenu, String name, String remark, String img,
			String channel, Date addtime, Date updatetime,
			Boolean state, Integer ordno, Integer nlevel, String scort,
			Set<TOperate> TOperates, Set<TMenu> TMenus) {
		this.TMenu = TMenu;
		this.name = name;
		this.remark = remark;
		this.img = img;
		this.channel = channel;
		this.addtime = addtime;
		this.updatetime = updatetime;
		this.state = state;
		this.ordno = ordno;
		this.nlevel = nlevel;
		this.scort = scort;
		this.TOperates = TOperates;
		this.TMenus = TMenus;
	}

	 

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PID")
	public TMenu getTMenu() {
		return this.TMenu;
	}

	public void setTMenu(TMenu TMenu) {
		this.TMenu = TMenu;
	}

	@Column(name = "NAME", nullable = false, length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "REMARK", length = 2000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "IMG", length = 100)
	public String getImg() {
		return this.img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	@Column(name = "CHANNEL", length = 100)
	public String getChannel() {
		return this.channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}

	@Column(name = "PARAM", length = 200)
	public String getParam() {
		return param;
	}

	public void setParam(String param) {
		this.param = param;
	}

	@Column(name = "ADDTIME", nullable = false, length = 19)
	public Date getAddtime() {
		return this.addtime;
	}

	public void setAddtime(Date addtime) {
		this.addtime = addtime;
	}

	@Column(name = "UPDATETIME", nullable = false, length = 19)
	public Date getUpdatetime() {
		return this.updatetime;
	}

	public void setUpdatetime(Date updatetime) {
		this.updatetime = updatetime;
	}

	@Column(name = "STATE", nullable = false)
	public Boolean getState() {
		return this.state;
	}

	public void setState(Boolean state) {
		this.state = state;
	}

	@Column(name = "ORDNO")
	public Integer getOrdno() {
		return this.ordno;
	}

	public void setOrdno(Integer ordno) {
		this.ordno = ordno;
	}

	@Column(name = "NLEVEL")
	public Integer getNlevel() {
		return this.nlevel;
	}

	public void setNlevel(Integer nlevel) {
		this.nlevel = nlevel;
	}

	@Column(name = "SCORT", length = 8000)
	public String getScort() {
		return this.scort;
	}

	public void setScort(String scort) {
		this.scort = scort;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TMenu")
	@OrderBy("ordno")
	public Set<TOperate> getTOperates() {
		return this.TOperates;
	}

	public void setTOperates(Set<TOperate> TOperates) {
		this.TOperates = TOperates;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TMenu")
	@OrderBy("ordno")
	public Set<TMenu> getTMenus() {
		return this.TMenus;
	}

	public void setTMenus(Set<TMenu> TMenus) {
		this.TMenus = TMenus;
	}

}